// 权限管理路由

const express = require('express')

const router = express.Router()

// 导入权限路由处理函数模块
const categoryHandle = require('../router_handler/categories')

// 商品分类数据列表
// 获取列表
router.get('/categories', categoryHandle.getCategories)
    // 添加分类
router.post('/categories', categoryHandle.addCategories)
    // 查询
router.get('/categories/:id', categoryHandle.searchCategories)
    // 编辑提交
router.put('/categories/:id', categoryHandle.EditCategories)
    // 删除分类
router.delete('/categories/:id', categoryHandle.addsearchCategories)
    // 获取参数列表
router.get('/categories/:id/attributes', categoryHandle.selectCategories)
    //添加动态参数或者静态属性
router.post('/categories/:id/attributes', categoryHandle.UpdataCategories)
    // 根据 ID 查询参数
router.get('/categories/:id/attributes/:attrId', categoryHandle.selectIdCategories)
    // 编辑提交参数
router.put('/categories/:id/attributes/:attrId', categoryHandle.tijiaoIdCategories)
    //删除参数
router.delete('/categories/:id/attributes/:attrid', categoryHandle.deleteIdCategories)
    //编辑提交参数
router.put('/categories/:id/attributes/:attrId', categoryHandle.tijiaoIdCategories)
module.exports = router
    // /private/v1/